import http from "@/api";

/**
 * @name //common
 */
// 获取组织结构树形列表
export const getOrgTree = (params = {}) => {
  return http.get(`/department/organization/tree`, params, { noLoading: true });
};

/**
 * @name //common
 */
// 获取锁地图树形列表
export const getRoomMapTree = (params = {}) => {
  return http.get(`/room-map/tree`, params, { noLoading: true });
};

/**
 * @name //common
 */
// 获取地图树形列表
export const getMapTree = (params = {}) => {
  return http.get(`/map/tree`, params, { noLoading: true });
};

/**
 * 获取用户门禁组树
 * @param params
 */
export const getGroupTree = (params = {}) => {
  return http.get(`/rule-group/tree`, params, { noLoading: true });
};

// 获取卡分类
export const getEtagClass = (params = { classCheck: true }) => {
  return http.get(`/etag/class/query`, params, { noLoading: true });
};

// 获取一卡通类型
export const getEcardTypes = (params = {}) => {
  return http.get(`/lookup/ecard/types`, params, { noLoading: true });
};

// 获取Uid
export const getUid = cardType => {
  return http.jsonp(`http://127.0.0.1:8088/getUID?callback=callback&cardType=${cardType}`);
};

// 获取tagKey
export const getTagKey = cardType => {
  return http.jsonp(`http://127.0.0.1:8088/getTagKey?callback=callback&cardType=${cardType}`);
};

// 获取FingerId
export const getFinger = fingerID => {
  return http.jsonp(`http://127.0.0.1:8088/getFinger?callback=callback&fingerID=${fingerID}`);
};

// 获取 fingerMode
export const getFingerMode = () => {
  return http.jsonp(`http://127.0.0.1:8088/getFingerMode?callback=callback`);
};

// 比对 fingerMode
export const compareMode = (fingerModeData = {}) => {
  return http.jsonp(`http://127.0.0.1:8088/compareMode?callback=callback&fingerModeData=${JSON.stringify(fingerModeData)}`);
};
